﻿using StaffModule.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkshopModule.Tools;

namespace StaffModule.Models {
    [Table("StaffDetails")]
    public class StaffDetails : INotifyPropertyChanged {
        //属性变更通知
        public event PropertyChangedEventHandler? PropertyChanged;

        //员工编号
        private int _Id;
		[Key]
		public int Id {
			get { return _Id; }
			set { _Id = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Id"));
            }
		}
		//员工工号
		private string _EmployeeId;

		public string EmployeeId {
			get { return _EmployeeId; }
			set { _EmployeeId = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("EmployeeId"));
            }
		}

		//姓名
		private string _Name;

		public string Name {
			get { return _Name; }
			set { _Name = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Name"));
            }
		}
		//年龄
		private int _Age;

		public int Age {
			get { return _Age; }
			set { _Age = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Age"));
            }
		}

		//职位
		private Position _Position;

		public Position Position {
			get { return _Position; }
			set { _Position = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Position"));
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("position"));
            }
		}

		//只读
		public string position {
			get { return EnumDependency.GetEnumDescription(_Position); }
		}

		//手机号码
		private string _Phone;

		public string Phone {
			get { return _Phone; }
			set { _Phone = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Phone"));
            }
		}






	}
}
